package org.casper.outofmemory;

import java.util.Map;
import java.util.Random;

public class TestWrapper {
	
	/**
	 * 执行参数:java -Xmx20m
	 * 演示异常:java.lang.OutOfMemoryError: GC overhead limit exceeded
	 * 解决方法：-XX:-UseGCOverheadLimit
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static void main(String[] args) {
		Map map = System.getProperties();
		Random random = new Random();
		while(true){
			map.put(random.nextInt(), "value");
		}
	}
}
